﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="TLCongNoTraVAT.aspx.cs" Inherits="TLCongNoTraVAT" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Thanh tóan công nợ trả có VAT</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Tháng</span><br />
                                <asp:DropDownList ID="dlThang" runat="server" CssClass="form-control with98" AutoPostBack="true"
                                    OnSelectedIndexChanged="dlThang_SelectedIndexChanged">
                                    <asp:ListItem Text="Theo thời gian" Value=""></asp:ListItem>
                                    <asp:ListItem Text="Tháng 1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 2" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 3" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 4" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 5" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 6" Value="6"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 7" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 8" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 9" Value="9"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 10" Value="10"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 11" Value="11"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 12" Value="12"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="dlThang" ErrorMessage="Chọn thời gian" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                Năm<br />
                                <asp:DropDownList ID="dlNam" runat="server" CssClass="form-control with98" AutoPostBack="true"
                                    OnSelectedIndexChanged="dlThang_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td>
                                Nhà cung cấp<br />
                                <asp:DropDownList ID="drnhacungcap" CssClass="form-control" runat="server" DataTextField="TenNCC"
                                    DataValueField="ids" AutoPostBack="true" OnSelectedIndexChanged="drnhacungcap_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="drnhacungcap" ErrorMessage="Chọn nhà cung cấp" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                Số dư kì trước<br />
                                <asp:TextBox ID="txtsodukitruoc" CssClass="form-control" runat="server" Enabled="false">
                                </asp:TextBox>
                            </td>
                            <td>
                                Tiền hàng<br />
                                <asp:TextBox ID="txttienhang" CssClass="form-control" runat="server" Enabled="false">
                                </asp:TextBox>
                            </td>
                            <td>
                                Tiền cước<br />
                                <asp:TextBox ID="txttiencuoc" CssClass="form-control" runat="server" Enabled="false">
                                </asp:TextBox>
                            </td>
                            <td>
                                Thành tiền kỳ này<br />
                                <asp:TextBox ID="txtthanhtienkynay" CssClass="form-control" runat="server" Enabled="false">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Số tiền đã thanh toán kỳ này<br />
                                <asp:TextBox ID="txtsotiendathanhtoan" CssClass="form-control" runat="server" AutoPostBack="true"
                                    OnTextChanged="txtsotienthanhtoan_TextChanged">
                                </asp:TextBox>
                            </td>
                            <td>
                                Số tiền thanh toán kỳ này<br />
                                <asp:TextBox ID="txtsotienthanhtoan" CssClass="form-control" runat="server" AutoPostBack="true"
                                    OnTextChanged="txtsotienthanhtoan_TextChanged">
                                </asp:TextBox>
                            </td>
                            <td>
                                Số tiền còn lại<br />
                                <asp:TextBox ID="txtsotienconlai" CssClass="form-control" runat="server" Enabled="false">
                                </asp:TextBox>
                            </td>
                            <td>
                                Ngày thanh toán<br />
                                <asp:TextBox ID="txtngaythanhtoan" CssClass="form-control" runat="server">
                                </asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender1" runat="server"
                                    TargetControlID="txtngaythanhtoan" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtngaythanhtoan" ValidChars="/" />
                                    <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator3" runat="server"
                                    ControlToValidate="txtngaythanhtoan" ErrorMessage="Chọn ngày thanh toán" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                Hình thức thanh toán<br />
                                <asp:DropDownList ID="drhinhthucthanhtoan" CssClass="form-control" runat="server"
                                    AutoPostBack="true" OnSelectedIndexChanged="drhinhthucthanhtoan_SelectedIndexChanged">
                                    <asp:ListItem Value="" Text="Chọn hình thức thanh toán"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Ngân hàng"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Tiền mặt"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="Đối trừ công nợ"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator4" runat="server"
                                    ControlToValidate="drhinhthucthanhtoan" ErrorMessage="Chọn hình thức thanh toán" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <asp:Label runat="server" Visible="false"> Ngân hàng</asp:Label><br />
                                <asp:DropDownList ID="drnganhang" DataTextField="NganHang" AutoPostBack="true" DataValueField="IDs"
                                    CssClass="form-control" runat="server" Visible="false" OnSelectedIndexChanged="drnganhang_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:Label runat="server" Visible="false">  Tài khoản</asp:Label><br />
                                <asp:DropDownList Visible="false" ID="drtaikhoan" DataTextField="TaiKhoan" DataValueField="IDs"
                                    CssClass="form-control" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                                    Text="Lưu lại" CssClass="btn btn-primary" onclick="btnSave_Click"  />
                            </td>
                        </tr>
                    </table>
                    
                </div>
            </div>
            <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
            <div style="margin: 5px;">
                <div class="panel panel-default">
                 <div class="panel-heading">
                        <b>Danh sách thanh toán</b>
                    </div>
                    <asp:DropDownList ID="drthang" runat="server" Width="150px" 
                            CssClass="form-control">
                            
                            <asp:ListItem Text="Tháng 1" Value="1"></asp:ListItem>
                            <asp:ListItem Text="Tháng 2" Value="2"></asp:ListItem>
                            <asp:ListItem Text="Tháng 3" Value="3"></asp:ListItem>
                            <asp:ListItem Text="Tháng 4" Value="4"></asp:ListItem>
                            <asp:ListItem Text="Tháng 5" Value="5"></asp:ListItem>
                            <asp:ListItem Text="Tháng 6" Value="6"></asp:ListItem>
                            <asp:ListItem Text="Tháng 7" Value="7"></asp:ListItem>
                            <asp:ListItem Text="Tháng 8" Value="8"></asp:ListItem>
                            <asp:ListItem Text="Tháng 9" Value="9"></asp:ListItem>
                            <asp:ListItem Text="Tháng 10" Value="10"></asp:ListItem>
                            <asp:ListItem Text="Tháng 11" Value="11"></asp:ListItem>
                            <asp:ListItem Text="Tháng 12" Value="12"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="drnam" runat="server" Width="140px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlnhacungcap" runat="server" DataValueField="IDs" Width="250px" CssClass="form-control"
                            DataTextField="TenNCC">
                        </asp:DropDownList>
                        <asp:Button ID="btnXem" CssClass="btn btn-warning" runat="server" 
                        Text="Xem dữ liệu" onclick="btnXem_Click"
                             />
                <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" CssClass="form-control withall" 
                            Width="99%" >
                            <Columns>
                               
                                <asp:BoundField DataField="TenNCC" ItemStyle-CssClass="padding" HeaderText="Bên nhận tiền"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="sotienthanhtoan" ItemStyle-CssClass="padding" HeaderText="Số tiền thanh toán"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="hinhthuc" ItemStyle-CssClass="padding" HeaderText="Hình thức thanh toán"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="taikhoan" ItemStyle-CssClass="padding" HeaderText="Tài khoản"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                
                                <asp:BoundField DataField="ngaythanhtoan" ItemStyle-CssClass="padding" HeaderText="Ngày thanh toán"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Right" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                </div>
                 <div style="margin: 5px;">
                            <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                            <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                                OnClick="btnPre_Click" />
                            <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                                OnClick="btnNext_Click" />
                        </div>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
